import { request } from '@/utils/request.js'
import { transFormData } from '@/utils/transformData'

const baseUrl = `/api/appointment`

export function _getList(data) {
  data = transFormData(data)
  return request({
    url: baseUrl + '/myReview',
    method: 'get',
    params: {
      ...data
    }
  })
}

export function _getDetail(id) {
  return request({
    url: baseUrl + '/' + id,
    method: 'get'
  })
}

export function _agree(id) {
  return request({
    url: baseUrl + '/agree',
    method: 'patch',
    data: { id }
  })
}

export function _disAgree(id, reason) {
  return request({
    url: baseUrl + '/disagree',
    method: 'patch',
    data: { id, reason }
  })
}
